package com.stars.common.valid;

/**
 * @ClassName ValidRegex
 * @Description:
 * @Author DJ
 * @Date 2019/11/6
 * @Version V1.0
 **/
public class ValidRegex {
    //手机号
    public static final String PHONE ="/^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$/";
    public static final String PHONE_MSG ="手机格式输入不正确";
    //邮箱
    public static final String EMAIL ="/^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/";
    public static final String EMAIL_MSG ="邮箱格式输入不正确";
    //邮编
    public static final String ZIP_CODE ="/[1-9]\\d{5}(?!\\d)/";
    public static final String ZIP_CODE_MSG ="邮编格式输入不正确";
    //金额
    public static final String MONEY_PATTERN ="/(^[1-9]([0-9]+)?(\\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\\.[0-9]([0-9])?$)/";
    public static final String MONEY_PATTERN_MSG ="金额格式输入不正确";
    //url
    public static final String INTERNET_URL ="/^http://([w-]+.)+[w-]+(/[w-./?%&=]*)?$/";
    public static final String INTERNET_URL_MSG ="URL地址输入不正确";
    //整数
    public static final String INT_PATTERN ="/^-?\\d+$/";
    public static final String INT_PATTERN_MSG ="必须是整数";
    //身份证
    public static final String ID_CODE ="/^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$/";
    public static final String ID_CODE_MSG ="身份证格式输入不正确";
    //正数
    public static final String POS_PATTERN ="/^\\d*\\.?\\d+$/";
    public static final String POS_PATTERN_MSG ="必须是正数";
    //负数
    public static final String NEG_PATTERN ="/^-\\d*\\.?\\d+$/";
    public static final String NEG_PATTERN_MSG ="必须是负数";
    //微信
    public static final String WX_PATTERN ="/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/";
    public static final String WX_PATTERN_MSG ="微信号格式输入不正确";
    //QQ
    public static final String QQ_PATTERN ="/^[1-9][0-9]{4,10}$/";
    public static final String QQ_PATTERN_MSG ="QQ号格式输入不正确";
    //密码强度正则，最少6位，包括至少1个大写字母，1个小写字母，1个数字，1个特殊字符
    public static final String PASSWORD_PATTERN ="/^.*(?=.{6,})(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/";
    public static final String PASSWORD_PATTERN_MSG ="密码强度正则，最少6位，包括至少1个大写字母，1个小写字母，1个数字，1个特殊字符";
    //用户名正则，4到16位（字母，数字，下划线，减号）
    public static final String USER_PATTERN ="/^.*(?=.{6,})(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/";
    public static final String USER_PATTERN_MSG ="用户名正则，4到16位（字母，数字，下划线，减号）";
    //ipv4地址正则
    public static final String IP_PATTERN ="/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/";
    public static final String IP_PATTERN_MSG ="ip 输入错误";

}
